#include <TorusProRenderingApp/WinWindow.h>


WinWindow::~WinWindow(void)
{
}

//---------------------------------------------------------------------------
WinWindow::WinWindow()
{
	_hwnd = NULL;
}
//---------------------------------------------------------------------------
HWND WinWindow::Create(HINSTANCE hinst,
    				 LPCTSTR clsname,
	    			 LPCTSTR wndname,
	  	    		 HWND parent,
			    	 DWORD dStyle,
					 DWORD dXStyle,
				     int x,
     				 int y,
	     			 int width,
		    		 int height)
{
	_hwnd = CreateWindowEx(dXStyle, clsname, wndname, dStyle, x, y, width,
		                 height, parent, NULL, hinst, NULL);

	if( _hwnd != NULL )
		return _hwnd;
	return NULL;
}

BOOL WinWindow::Show(int dCmdShow)
{
	if(	ShowWindow(_hwnd, dCmdShow) && UpdateWindow(_hwnd) )
		return TRUE;
	return FALSE;
}

HWND WinWindow::getHWND()
{
	return _hwnd;
}

void WinWindow::close()
{
	PostMessage(_hwnd,WM_DESTROY,NULL,NULL);
}
